Macros Introduction

Use Macros to automate anything that you can do using the user interface. Macros are edited and executed from the Macro editor accessible under Developer ribbon > Macro Editor. The Macros that you create can be stored and used for the next project

Macros use the JavaScript language. For a simple reference to JavaScript, see JavaScript Tutorial.

For the complete API reference with examples, see Sym3 Macro API.

 

Examples of instances where macros would be used:

Macro Editor

 

 

Example 'Hello World' Macro:

 

 

 

Sample Macro to list all conveyors in the project:

for ( conv in Project.Equipment.Conveyors )
{
  print(conv.Name);
}

 

 

My Macros

Previously defined and saved JavaScript (.js) files can be retrieved (executed and edited) from Developer ribbon > My Macros .

These files are saved in the folder My Documents\Sym3 xxx\Macros where xxx is the application name e.g. Designer.

From Sym3 V6.0 on, a common location for all Sym3 products is created at install time and can be used for storing Macros. The default location is;

My Documents\Sym3 Common

A list of the available macros is first retrieved from the common location then from the product specific location.

 

In this screen example there are two Macros and a 'Tools' folder containing three macros in the Common location. The last Macro (ReadExcel) is in the product specific location. Right click on the Macro to select Run or Edit.

 

There will be two tabs for Macro.

1) Common

2) Product Specific (e.g Sym3 Integrator)

 

Following functionality will be available when you right click on background.

 

1) Create New Macro

2) Open containing folder

3) Edit with VS Code (If you have VS Code installed on your machine).